package fr.insa.bouton;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JPanel;

public class BoutonTrace extends JButton implements ActionListener
{
  JPanel ardoise;

  public BoutonTrace(String nom, JPanel ardoise)
    {
      super(nom);
      this.ardoise = ardoise;
      addActionListener(this);
    }

  public void actionPerformed(ActionEvent e)
    {
      Graphics g = ardoise.getGraphics();
      g.setColor(Color.yellow);
     
      g.drawOval(50, 20, 100, 100);
      g.setColor(Color.blue);
      g.fillOval(55, 25, 90, 90);  
    }
}